package com.dy.project.domain;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.HashMap;
import java.util.Map;

/**
 * 貨物清單子項模板
 */
public class CommodityOrderDtlTemplate {
    /** 訂單主項id */
    private Long comId;
    /** 訂單編號 */
    private String comNo;
    /** 訂單狀態 */
    private Integer comState;
    /** 訂單子項id */
    private Long codId;
    /** 囚犯編號 */
    private String dtStaffNo;
    /** 囚犯姓名*/
    private String dtName;
    /** 商品id */
    private Long acId;
    /** 商品中文名 */
    private String acNameZh;
    /** 商品葡文名 */
    private String acNamePt;
    /** 商品英文名 */
    private String acNameEn;
    /** 商品名稱 */
    private String acName;
    /** 確認時數量 */
    private Integer codCountAffirm;
    /** 確認時單價 */
    private Double codPriceAffirm;
    /** 確認時總價 */
    private Double codTotalAffirm;
    /** 訂單子項狀態 */
    private Integer codState;
    /** 商品圖片地址 */
    private String acPhotoUrl;
    /** 沒有正在配貨中查詢條件 */
    @JsonIgnore
    private Boolean notDistribution;
    /** 请求参数 */
    @JsonIgnore
    private Map<String, Object> params;
    /** 请求参数JSON字符串 */
    @JsonIgnore
    private String paramsStr;
    /** 查詢開始時間 */
    @JsonIgnore
    private String beginTime;
    /** 查詢結束時間 */
    @JsonIgnore
    private String endTime;

    public Long getComId() {
        return comId;
    }

    public void setComId(Long comId) {
        this.comId = comId;
    }

    public String getComNo() {
        return comNo;
    }

    public void setComNo(String comNo) {
        this.comNo = comNo;
    }

    public Long getCodId() {
        return codId;
    }

    public void setCodId(Long codId) {
        this.codId = codId;
    }

    public String getDtStaffNo() {
        return dtStaffNo;
    }

    public void setDtStaffNo(String dtStaffNo) {
        this.dtStaffNo = dtStaffNo;
    }

    public String getDtName() {
        return dtName;
    }

    public void setDtName(String dtName) {
        this.dtName = dtName;
    }

    public Long getAcId() {
        return acId;
    }

    public void setAcId(Long acId) {
        this.acId = acId;
    }

    public String getAcNameZh() {
        return acNameZh;
    }

    public void setAcNameZh(String acNameZh) {
        this.acNameZh = acNameZh;
    }

    public String getAcNamePt() {
        return acNamePt;
    }

    public void setAcNamePt(String acNamePt) {
        this.acNamePt = acNamePt;
    }

    public String getAcNameEn() {
        return acNameEn;
    }

    public void setAcNameEn(String acNameEn) {
        this.acNameEn = acNameEn;
    }

    public String getAcName() {
        return acName;
    }

    public void setAcName(String acName) {
        this.acName = acName;
    }

    public Integer getCodCountAffirm() {
        return codCountAffirm;
    }

    public void setCodCountAffirm(Integer codCountAffirm) {
        this.codCountAffirm = codCountAffirm;
    }

    public Double getCodPriceAffirm() {
        return codPriceAffirm;
    }

    public void setCodPriceAffirm(Double codPriceAffirm) {
        this.codPriceAffirm = codPriceAffirm;
    }

    public Double getCodTotalAffirm() {
        return codTotalAffirm;
    }

    public void setCodTotalAffirm(Double codTotalAffirm) {
        this.codTotalAffirm = codTotalAffirm;
    }

    public Integer getCodState() {
        return codState;
    }

    public void setCodState(Integer codState) {
        this.codState = codState;
    }

    public String getAcPhotoUrl() {
        return acPhotoUrl;
    }

    public void setAcPhotoUrl(String acPhotoUrl) {
        this.acPhotoUrl = acPhotoUrl;
    }

    public Boolean getNotDistribution() {
        return notDistribution;
    }

    public void setNotDistribution(Boolean notDistribution) {
        this.notDistribution = notDistribution;
    }

    public String getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public Integer getComState() {
        return comState;
    }

    public void setComState(Integer comState) {
        this.comState = comState;
    }

    public Map<String, Object> getParams()
    {
        if (params == null)
        {
            params = new HashMap<>();
        }
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }

    public String getParamsStr() {
        return paramsStr;
    }

    public void setParamsStr(String paramsStr) {
        this.paramsStr = paramsStr;
        JSONObject jo = JSONObject.parseObject(paramsStr);
        this.params = (Map<String,Object>)JSONObject.toJavaObject(jo,Map.class);
    }

    @Override
    public String toString() {
        return "CommodityOrderDtlTemplate{" +
                "comId=" + comId +
                ", comNo='" + comNo + '\'' +
                ", comState=" + comState +
                ", codId=" + codId +
                ", dtStaffNo='" + dtStaffNo + '\'' +
                ", dtName='" + dtName + '\'' +
                ", acId=" + acId +
                ", acNameZh='" + acNameZh + '\'' +
                ", acNamePt='" + acNamePt + '\'' +
                ", acNameEn='" + acNameEn + '\'' +
                ", acName='" + acName + '\'' +
                ", codCountAffirm=" + codCountAffirm +
                ", codPriceAffirm=" + codPriceAffirm +
                ", codTotalAffirm=" + codTotalAffirm +
                ", codState=" + codState +
                ", acPhotoUrl='" + acPhotoUrl + '\'' +
                ", notDistribution=" + notDistribution +
                '}';
    }
}
